﻿<?php
//开启session登录验证
session_start();
if (isset($_POST["submit"])) {
  if ($_POST["user"] == "clyc" && $_POST["pass"] ==
  "clyc") {
    $_SESSION["username"] = $_POST["user"];
    if (isset($_GET["url"])) {
      
        //$url = $_GET["url"];
    } else {
        
        $url = "./index.html";
    }
 
    if (!isset($_COOKIE[session_name()])) {
      if (strstr($url, "?")) {
        header("Location: " . $url .
          "&" . session_name() . "=" . session_id());
      } else {
        header("Location: " . $url .
          "?" . session_name() . "=" . session_id());
      }
    } else {
      header("Location: " . $url);
    }
  }
}
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<title>登录</title>
		<link rel="stylesheet" type="text/css" href="css/global.css" />
		<link rel="stylesheet" type="text/css" href="css/login.css" />
	</head>

	<body>
	<div id="login">
		<h1><a href="#">LOGO</a></h1>
		<form id="" name="" method="post" action="">
			<p>
				<label for="user">用户名<br>
				<input type="text" tabindex="10" size="20" value="" class="inpu" id="user" name="user" /></label>
			</p>
			<p>
				<label for="pass">密码<br>
				<input type="text" tabindex="10" size="20" value="" class="inpu" id="pass" name="pass" /></label>
			</p>
			<div class="clearfix">
			<p class="forgetmenot">
				<label for="rememberme"><input type="checkbox" tabindex="90" value="forever" id="rememberme" name="rememberme"> 记住我的登录信息</label>
			</p>
			<p class="nore">
				<a href="#">忘记密码？</a>
			</p>
			</div>
			<input type="submit" name="submit" value="登录" />
		</form>
	</div>
	</body>
</html>

